﻿using Entity;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Utils;

namespace DataBaseConnect.IRepositories
{
    /// <summary>
    /// 权限管理仓储接口
    /// </summary>
    public interface IRoleRepository : IRepository<Role>
    {
        /// <summary>
        /// 获取用户角色
        /// </summary>
        /// <param name="UserId">用户id</param>
        /// <returns></returns>
        UserRole GetUserRole(int UserId);

        /// <summary>
        /// 设置用户角色
        /// </summary>
        /// <param name="Input">用户角色实体</param>
        /// <returns></returns>
        ReceiveStatus SetRole(UserRole Input);

        /// <summary>
        ///  根据条件删除对应的用户角色
        /// </summary>
        /// <param name="where">删除条件</param>
        /// <returns></returns>
        ReceiveStatus DelUserRoleMsg(Expression<Func<UserRole, bool>> where);

        /// <summary>
        /// 根据条件删除对应的角色菜单权限
        /// </summary>
        /// <param name="where">删除条件</param>
        /// <returns></returns>
        ReceiveStatus DelMenuRoleMsg(Expression<Func<MenuRole, bool>> where);

        /// <summary>
        /// 设置角色菜单权限
        /// </summary>
        /// <param name="MenuRole">实体信息</param>
        /// <returns></returns>
        ReceiveStatus SetMenuRoleMsg(List<MenuRole> Input);
    }
}
